package cc.rengu.redp.bizimpl.upmp.dao;

import cc.rengu.redp.bizimpl.upmp.domain.UpmpBMchntBaseInfo;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 刘玉亮.LL
 * @since 2021-06-22
 */
@Repository
@DS("upmp")
public interface UpmpBMchntBaseInfoMapper extends BaseMapper<UpmpBMchntBaseInfo> {

    @Select("select count(*) as count from T_B_MCHNT_BASE_INFO where substr(create_time,0,10)= #{yestdate} and sign_inst_id =#{userOrgCodes}  and mchnt_status='01' ")
    int getCounts(@Param("yestdate") String yestdate, @Param("userOrgCodes") String userOrgCodes);

    List<UpmpBMchntBaseInfo> findByInstId(String instId);
    List<UpmpBMchntBaseInfo> getBMchntBaseInfoBySignInstId(String signinstid, String instId);
    Integer save(@Param("bmchntbaseinfo")UpmpBMchntBaseInfo bmchntbaseinfo);
}
